﻿<%@ Page Title="" Language="C#" MasterPageFile="~/System/MasterPage_Base.master"
    AutoEventWireup="true" CodeFile="IndexModify.aspx.cs" Inherits="System_Page_IndexModify"
    ValidateRequest="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="Server">

    <link href="../Resources/Kindeditor/themes/default/default.css" rel="stylesheet"
        type="text/css" />

    <script src="../Resources/Kindeditor/kindeditor.js" type="text/javascript"></script>

    <script src="../Resources/Kindeditor/lang/zh_CN.js" type="text/javascript"></script>

    <script type="text/javascript">
        KindEditor.ready(function (K) {
            K.create('#<%=txt_IndexContent.ClientID%>', {
                uploadJson: '../Resources/Kindeditor/App/upload_json.ashx',
                fileManagerJson: '../Resources/Kindeditor/App/file_manager_json.ashx',
                allowFileManager: true
            });

            var editor = K.editor({
                uploadJson: '/System/Resources/Kindeditor/App/image_upload_json.ashx',
                fileManagerJson: '/System/Resources/Kindeditor/App/image_manager_json.ashx',
                allowFileManager: true
            });
            K('.ImgSrc .Button').click(function () {
                var td = K(this).parent();
                editor.loadPlugin('insertfile', function () {
                    editor.plugin.fileDialog({
                        fileUrl: K('input[type=hidden]', td).val(),
                        clickFn: function (url, title) {
                            K('img', td).attr("src", url);
                            K('input[type=hidden]', td).val(url);
                            editor.hideDialog();
                        }
                    });
                });
            });
        });
    </script>

    <style type="text/css">
        table {
            margin-bottom: 30px;
        }

        .td1 {
            width: 100px;
            border: solid 1px #333333;
            background-color: #CCCCCC;
        }

        .td2 {
            width: 600px;
            border: solid 1px #333333;
            padding: 5px;
        }

        .td3 {
            width: 100px;
            border: solid 1px #333333;
            text-align: center;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Title" runat="Server">
    首面编辑
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Content" runat="Server">
    <div>
        <table border="0" style="border-collapse: collapse;">
            <tr>
                <td class="td1">
                    <span style="font-size: 18px;">公司简介（网站首页）</span>
                </td>
            </tr>
            <tr>
                <td class="td2">
                    <asp:TextBox ID="txt_IndexContent" runat="server" TextMode="MultiLine" Width="700"
                        Height="300"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td colspan="2" style="text-align: right; padding-right: 10px; padding-top: 10px;">
                    <asp:Button ID="btn_Submit" runat="server" Text="提交" CssClass="Button" CommandName="IndexAbout"
                        OnClick="btn_Submit_Click" />
                </td>
            </tr>
        </table>
    </div>
    <div>
        <table class="DataList" border="0" style="margin-top: 10px;">
            <tr>
                <th style="width: 100px;">图片
                </th>
                <th>标题
                </th>
                <th style="width: 200px;">连接
                </th>
                <th style="width: 40px;">排序
                </th>
                <th style="width: 80px;">是否启用
                </th>
                <th style="width: 120px;">操作
                </th>
            </tr>
            <asp:Repeater ID="RepeaterList" runat="server"
                OnItemCommand="RepeaterList_ItemCommand"
                OnItemDataBound="RepeaterList_ItemDataBound">
                <ItemTemplate>
                    <tr>
                        <td class="ImgSrc" style="text-align: right; width: 100px;">
                            <img src='<%# Eval("ImgSrc")%>' style="width: 100px; height: 60px; margin-top: 5px; margin-bottom: 5px; border: solid 1px gray; padding: 1px;" />
                            <asp:Button ID="btn_ImgSrc" runat="server" Visible="false" Text="选择图片" CssClass="Button"
                                Style="margin-top: -26px;" OnClientClick="return false" />
                            <asp:HiddenField ID="hf_ImaSrc" runat="server" Value='<%# Eval("ImgSrc")%>' />
                        </td>
                        <td>
                            <asp:Label ID="lab_Title" runat="server" Text='<%# Eval("Title")%>'></asp:Label>
                            <asp:TextBox ID="txt_Title" runat="server" Visible="false" Text='<%# Eval("Title")%>'
                                CssClass="TextBox"></asp:TextBox>
                        </td>
                        <td style="text-align: center;">
                            <asp:Label ID="lab_LinkHref" runat="server" Text='<%# Eval("LinkHref")%>'></asp:Label>
                            <asp:TextBox ID="txt_LinkHref" runat="server" Visible="false" Text='<%# Eval("LinkHref")%>'
                                CssClass="TextBox" Width="160"></asp:TextBox>
                        </td>
                        <td style="text-align: center;">
                            <asp:Label ID="lab_OrderNo" runat="server" Text='<%#Eval("OrderNo")%>'></asp:Label>
                            <asp:TextBox ID="txt_OrderNo" runat="server" Visible="false" Text='<%#Eval("OrderNo")%>'
                                CssClass="TextBox" Width="40"></asp:TextBox>
                        </td>
                        <td style="text-align: center;">
                            <asp:Label ID="ValidText" runat="server" Text="启用"></asp:Label>
                            <asp:LinkButton ID="BtnOperate" runat="server" CommandName="Valid" CommandArgument='<%#Eval("IndexImgId") %>'>修改</asp:LinkButton>
                        </td>
                        <td style="text-align: center;">
                            <asp:LinkButton ID="lbtn_Modify" CommandName="Modify" runat="server">编辑</asp:LinkButton>
                            <asp:LinkButton ID="lbtn_Update" CommandName="Update" CommandArgument='<%#Eval("IndexImgId") %>'
                                runat="server" Visible="false">修改</asp:LinkButton>
                            <asp:LinkButton ID="lbtn_Cancel" CommandName="Cancel" runat="server" Visible="false">取消</asp:LinkButton>
                            <%--<a href='BannerModify.aspx?Action=Update&Id=<%#Eval("BannerId") %>'>编辑</a>--%>
                            <asp:LinkButton ID="lbtn_Delete" CommandName="Delete" CommandArgument='<%#Eval("IndexImgId") %>'
                                runat="server" OnClientClick="return isDelete()">删除</asp:LinkButton>
                        </td>
                    </tr>
                </ItemTemplate>
            </asp:Repeater>
            <tr>
                <td class="ImgSrc" style="text-align: right;">
                    <img src='<%# Eval("ImgSrc")%>' style="width: 100px; height: 60px; margin-top: 5px; margin-bottom: 5px; border: solid 1px gray; padding: 1px; background-color: #EEEEEE;" />
                    <input type="button" value="选择图片" class="Button" style="margin-top: -26px;" />
                    <asp:HiddenField ID="hf_ImaSrc" runat="server" Value='' />
                </td>
                <td>
                    <asp:TextBox ID="txt_Title" runat="server" CssClass="TextBox" Width="100"></asp:TextBox>
                </td>
                <td style="text-align: center;">
                    <asp:TextBox ID="txt_LinkHref" runat="server" CssClass="TextBox" Width="160"></asp:TextBox>
                </td>
                <td style="text-align: center; width: 60px;">
                    <asp:TextBox ID="txt_OrderNo" runat="server" CssClass="TextBox" Width="40"></asp:TextBox>
                </td>
                <td></td>
                <td style="text-align: center;">
                    <asp:LinkButton ID="lbtn_Add" runat="server" ValidationGroup="Check" OnClick="lbtn_Add_Click">新增</asp:LinkButton>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
